<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <title>登录</title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/5.0.2/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
    <div class="container mt-5">
        <div class="row justify-content-center">
            <div class="col-md-6">
                <div class="card">
                    <div class="card-header">
                        <h3 class="text-center">用户登录</h3>
                    </div>
                    <div class="card-body">
                        <div th:if="${param.registered}" class="alert alert-success">
                            注册成功，请登录
                        </div>
                        <div th:if="${param.passwordUpdated}" class="alert alert-success">
                            密码修改成功，请重新登录
                        </div>
                        <div th:if="${param.logout}" class="alert alert-info">
                            您已成功退出登录
                        </div>
                        <form th:action="@{/user/login}" method="post">
                            <div class="mb-3">
                                <label for="username" class="form-label">用户名</label>
                                <input type="text" class="form-control" id="username" name="username" required>
                            </div>
                            <div class="mb-3">
                                <label for="password" class="form-label">密码</label>
                                <input type="password" class="form-control" id="password" name="password" required>
                            </div>
                            <div class="text-danger mb-3" th:if="${error}" th:text="${error}"></div>
                            <button type="submit" class="btn btn-primary w-100 mb-3">登录</button>
                            <div class="text-center">
                                <a th:href="@{/user/register}" class="text-decoration-none">还没有账号？立即注册</a>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</body>
</html> 